package com.youbug.kefu.controller;


import com.youbug.kefu.entity.Dictionary;
import com.youbug.kefu.entity.Org;
import com.youbug.kefu.service.ICommonService;
import com.youbug.kefu.service.IDicTypeService;
import com.youbug.kefu.service.IDictionaryService;
import com.youbug.kefu.service.IOrgService;
import com.youbug.kefu.vo.CommonTreeVo;
import com.youbug.kefu.vo.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 通用查询前端控制器
 * </p>
 *
 * @author youbug
 * @since 2023-02-12
 */
@RestController
@RequestMapping("/common")
public class CommonController {

    @Autowired
    private ICommonService commonService;

    @GetMapping("/getAllOrgTrees")
    public R<List<CommonTreeVo>> getDicTypes(){

        List<CommonTreeVo> orgTree = commonService.getOrgTree();

        return R.ok(orgTree);
    }

}

